<?php
	('Access-Control-Allow-Origin：*');
	include("mysql.php");
	$id = $_POST["id"];
    $num = $_POST["num"];
    $checkQuery = $_POST["checkQuery"];
	$db = new mysql();
	 //sole  1  是单个  2 是批量
     /*num   1是已报名 2是确认缴费  3取消报名   4取消缴费  5 删除学生 */ 
    if($num==1){
		if ($checkQuery) {
			$sql = "UPDATE students SET isBao = '1' WHERE id in ({$checkQuery})";
		}else{
			$sql = "UPDATE students SET isBao = '1' WHERE id = '{$id}'";
		}
    }
    else if($num==2){
		if ($checkQuery) {
			$sql = "UPDATE students SET ispay = '1' WHERE id in ({$checkQuery})";
		}else{
			$sql = "update students set ispay = '1' where id = '{$id}'";
		}
    }else if($num==3){
		if ($checkQuery) {
			$sql = "UPDATE students SET isBao = '0' WHERE id in ({$checkQuery})";
		}else{
			$sql = "UPDATE students SET isBao = '0' WHERE id = '{$id}'";
		}
	}
	else if($num==4){
		if ($checkQuery) {
			$sql = "UPDATE students SET ispay = '0' WHERE id in ({$checkQuery})";
		}else{
			$sql = "UPDATE students SET ispay = '0' WHERE id = '{$id}'";
		}
	}
	else if($num==5){
		if ($checkQuery) {
			$sql = "delete from students WHERE id in ({$checkQuery})";
		}else{
			$sql = "delete from students WHERE id = '{$id}'";
		}
	}
	echo $db->Query($sql);
	$db->close();
?>